//
//  FourBarViewController.m
//  JiJinFinance
//
//  Created by 李东晓 on 15/12/1.
//  Copyright © 2015年 LiDongXiao. All rights reserved.
//

#import "FourBarViewController.h"
#import "RechargeViewController.h"
#import "MessageViewController.h"
#import "RecordViewController.h"
#import "DrawViewController.h"
#import "InformationViewController.h"
@interface FourBarViewController ()
{
        NSMutableArray * BarButArray;
}
@property (weak, nonatomic) IBOutlet UIView *ViewZH;
@property (strong, nonatomic) IBOutlet UILabel *LabelZCZH;
@property (strong, nonatomic) IBOutlet UILabel *LabelZCZHYuan;
@property (strong, nonatomic) IBOutlet UIImageView *ImageHB;
@property (strong, nonatomic) IBOutlet UILabel *LabelHBYuan;
@property (strong, nonatomic) IBOutlet UILabel *LabelHBYuanZi;

@property (strong, nonatomic) IBOutlet UILabel *LabelKYYE;
@property (strong, nonatomic) IBOutlet UILabel *LabelKYYEYuan;

@property (weak, nonatomic) IBOutlet UIView *ViewXian1;
@property (strong, nonatomic) IBOutlet UILabel *LabelTZJE;
@property (strong, nonatomic) IBOutlet UILabel *LabelTZJEYuan;

@property (strong, nonatomic) IBOutlet UIView *ViewXian2;
@property (strong, nonatomic) IBOutlet UILabel *LabelSYZSY;
@property (strong, nonatomic) IBOutlet UILabel *LabelSYZSYYuan;

@property (strong, nonatomic) IBOutlet UIButton *ButTX;
@property (strong, nonatomic) IBOutlet UIButton *ButCZ;

@property (strong, nonatomic) IBOutlet UIButton *ButTZJL;
@property (strong, nonatomic) IBOutlet UIButton *ButSZMX;
@property (strong, nonatomic) IBOutlet UIButton *ButGRXX;

@property (strong, nonatomic) IBOutlet UIImageView *Image1;
@property (strong, nonatomic) IBOutlet UIImageView *Image2;
@property (strong, nonatomic) IBOutlet UIImageView *Image3;

@end

@implementation FourBarViewController

-(void)viewWillAppear:(BOOL)animated
{
    [self.tabBarController.tabBar setHidden:NO];
}



- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"我的账户";
    
    //自定义Title的大小
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:19],NSForegroundColorAttributeName:[UIColor whiteColor]}];
    
    BarButArray = [[NSMutableArray alloc]init];
    
    [self BarButtonItemloadView];

    
    [self Frame];
    [self Fount];
}

-(void)BarButtonItemloadView
{
    UIButton * barbut = [UIButton buttonWithType:UIButtonTypeCustom];
    [barbut setImage:[UIImage imageNamed:@"mycount_03"] forState:UIControlStateNormal];
    [barbut setFrame:CGRectMake(0, 0, 17, 13)];
    [barbut addTarget:self action:@selector(BarbutClick) forControlEvents:UIControlEventTouchUpInside];
  
    
    UIButton * barbutmessage = [UIButton buttonWithType:UIButtonTypeCustom];
    [barbutmessage setTitle:@"消息" forState:UIControlStateNormal];
    [barbutmessage setFrame:CGRectMake(0, 0, 27, 13)];
    [barbutmessage addTarget:self action:@selector(BarbutmessageClick) forControlEvents:UIControlEventTouchUpInside];
    [barbutmessage.titleLabel setFont:[UIFont systemFontOfSize:13]];
    
    
    UIBarButtonItem * bar = [[UIBarButtonItem alloc]initWithCustomView:barbutmessage];
    UIBarButtonItem * bar1 = [[UIBarButtonItem alloc]initWithCustomView:barbut];
    [BarButArray addObject:bar];
    [BarButArray addObject:bar1];
    self.navigationItem.rightBarButtonItems = BarButArray;
    
}
-(void)BarbutClick
{
    NSLog(@"消息");
    InformationViewController * infmation = [[InformationViewController alloc]init];
    [self.navigationController pushViewController:infmation animated:YES];
    
    
}
-(void)BarbutmessageClick
{
    NSLog(@"消息");
    InformationViewController * infmation = [[InformationViewController alloc]init];
    [self.navigationController pushViewController:infmation animated:YES];
}

-(void)Frame
{
    //View
    [_ViewZH setFrame:CGRectMake(0, 62, kUIScreenWidth, 222*D_height)];
    [_LabelZCZH setFrame:CGRectMake(24*D_width, 26*D_height, 100*D_width, 16*D_height)];
    [_LabelZCZHYuan setFrame:CGRectMake(24*D_width, 64*D_height, 220*D_width, 30*D_height)];
    [_LabelHBYuan setFrame:CGRectMake(289*D_width, 23*D_height, 52*D_width, 20*D_height)];
    [_LabelHBYuanZi setFrame:CGRectMake(342*D_width, 27*D_height, 14*D_width, 13*D_height)];
    [_ImageHB setFrame:CGRectMake(269*D_width, 25*D_height, 14*D_width, 16*D_height)];
    
    [_LabelKYYE setFrame:CGRectMake(23*D_width, 142*D_height, 100*D_width, 13*D_height)];
    [_LabelKYYEYuan setFrame:CGRectMake(24*D_width, 168*D_height, 54*D_width, 21*D_height)];
    [_ViewXian1 setFrame:CGRectMake(119*D_width, 141*D_height, 1, 40*D_height)];
    [_LabelTZJE setFrame:CGRectMake(137*D_width, 142*D_height, 100*D_width, 13*D_height)];
    [_LabelTZJEYuan setFrame:CGRectMake(137*D_width, 168*D_height, 54*D_width, 21*D_height)];
    [_ViewXian2 setFrame:CGRectMake(239*D_width, 141*D_height, 1, 40*D_height)];
    [_LabelSYZSY setFrame:CGRectMake(259*D_width, 142*D_height, 110*D_width, 13*D_height)];
    [_LabelSYZSYYuan setFrame:CGRectMake(259*D_width, 168*D_height, 54*D_width, 21*D_height)];
    
    //Button
    [_ButTX setFrame:CGRectMake(0, 222*D_height + 62, 187*D_width, 40*D_height)];
    [_ButCZ setFrame:CGRectMake(189*D_width, 222*D_height + 62, 186*D_width, 40*D_height)];
    [_ButTZJL setFrame:CGRectMake(0, 364*D_height, kUIScreenWidth, 40*D_height)];
    [_ButSZMX setFrame:CGRectMake(0, 415*D_height, kUIScreenWidth, 40*D_height)];
    [_ButGRXX setFrame:CGRectMake(0, 468*D_height, kUIScreenWidth, 40*D_height)];
    
    [_Image1 setFrame:CGRectMake(357*D_width, 379*D_height, 6, 9)];
    [_Image2 setFrame:CGRectMake(357*D_width, 432*D_height, 6, 9)];
    [_Image3 setFrame:CGRectMake(357*D_width, 484*D_height, 6, 9)];
    
}

-(void)Fount
{
    [_LabelZCZH setFont:[UIFont systemFontOfSize:13*D_height]];
    [_LabelHBYuan setFont:[UIFont systemFontOfSize:16*D_height]];
    [_LabelHBYuanZi setFont:[UIFont systemFontOfSize:13*D_height]];
    [_LabelZCZHYuan setFont:[UIFont systemFontOfSize:30*D_height]];
    [_LabelKYYE setFont:kGlobalTintFont];
    [_LabelKYYEYuan setFont:kGlobalFont];
    [_LabelTZJE setFont:kGlobalTintFont];
    [_LabelTZJEYuan setFont:kGlobalFont];
    [_LabelSYZSY setFont:kGlobalTintFont];
    [_LabelSYZSYYuan setFont:kGlobalFont];
}
- (IBAction)ButDrawClick {
    NSLog(@"提现");
    DrawViewController * draw = [[DrawViewController alloc]init];
    [self.navigationController pushViewController:draw animated:YES];
    
}

- (IBAction)ButRecharge {
    NSLog(@"充值");
    RechargeViewController * recharge = [[RechargeViewController alloc]init];
    [self.navigationController pushViewController:recharge animated:YES];
}




- (IBAction)ButTZJLClick {
    NSLog(@"投资记录");
    RecordViewController * record = [[RecordViewController alloc]init];
    [self.navigationController pushViewController:record animated:YES];
    
}
- (IBAction)ButSZMXClick {
    NSLog(@"收支明细");
}

- (IBAction)ButGRXXClick {
    NSLog(@"个人信息");
    MessageViewController * message = [[MessageViewController alloc]init];
    [self.navigationController pushViewController:message animated:YES];
    
}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
